<?php $this->load->view('admin/public/head.html', array('js' => array(
), 'css' => array(
    '/assets/admin/css/admin/common.css',
    '/assets/library/plugins/daterangepicker/daterangepicker.css',
    '/assets/library/plugins/timepicker/bootstrap-timepicker.min.css'
))); ?>

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" ng-controller="admin-promoter-ticket-edit-controller">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            添加优惠券
        </h1>
        <ol class="breadcrumb">
            <li><a href="/home"><i class="fa fa-dashboard"></i> 后台首页</a></li>
            <li><a href="/promoter/ticket/index">优惠券列表</a></li>
            <li class="active">添加优惠券</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row adminBase">
            <div class="col-md-12">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">添加基地</h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">名称<span class="text-red">*</span></label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control" ng-model="ticket.name" id="name" placeholder="优惠券名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">使用平台<span class="text-red">*</span></label>
                                <div class="checkbox col-sm-6">
                                    <label style="margin-right: 20px;">
                                        <input type="checkbox" ng-model="ticket.wechat"> 微信
                                    </label>
                                    <label>
                                        <input type="checkbox" ng-model="ticket.app"> APP
                                    </label>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="num" class="col-sm-2 control-label">发放数量<span class="text-red">*</span></label>
                                <div class="col-sm-3">
                                    <input type="number" class="form-control" ng-model="ticket.num" id="num" placeholder="数量">
                                    <p class="help-block">发放数量为0表示不限制</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="amount" class="col-sm-2 control-label">优惠金额<span class="text-red">*</span></label>
                                <div class="col-sm-3">
                                    <input type="number" class="form-control" ng-model="ticket.amount" id="amount" placeholder="优惠金额">
                                    <p class="help-block">单位:元, 最多保留2位小数</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="limitAmount" class="col-sm-2 control-label">最小订单金额<span class="text-red">*</span></label>
                                <div class="col-sm-3">
                                    <input type="number" class="form-control" ng-model="ticket.limitAmount" id="limitAmount" placeholder="订单最小金额">
                                    <p class="help-block">单位:元, 最多保留2位小数</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="description" class="col-sm-2 control-label">使用描述</label>
                                <div class="col-sm-6">
                                    <textarea class="form-control" id="description" rows="5" placeholder="填写优惠券使用说明" ng-model="ticket.description"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="reservationtime" class="col-sm-2 control-label">起止时间</label>

                                <div class="col-sm-5">
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-clock-o"></i>
                                        </div>
                                        <input type="text" class="form-control pull-right" ng-model="times" id="reservationtime">
                                    </div>
                                </div>
                            </div>

                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <button type="submit" class="btn btn-default" onclick="history.go(-1)">返回列表</button>
                            <button type="submit" class="btn btn-info pull-right" ng-click="saveTicket()">确认修改</button>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array('js' => array(
    'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.js',
    '/assets/library/plugins/daterangepicker/daterangepicker.js',
    '/assets/admin/js/promoter/ticket/edit.js'
))); ?>
